import { createApp } from 'vue'
import App from './App.vue'
 // 前端使用pinia存储数据
 import { setupStore } from "@/store"
import { createPinia } from 'pinia'

import './style.css'
import router from './router'
//  引入store
// 加载全局样式
import './styles/index.scss'
//按需导入组件库
import { globalRegister } from './global'
//  引入组件库 element-plus 全部导入
import ElementPlus from 'element-plus'
import 'element-plus/dist/index.css'
import axios from 'axios'


import {
  getCurDate,
  setSessionStorage,
  getSessionStorage,
  removeSessionStorage,
  setLocalStorage,
  getLocalStorage,
  removeLocalStorage,
  querystring
} from './common.js'

const app = createApp(App)
setupStore(app)
app.use(router)
app.use(globalRegister)
app.use(ElementPlus).use(createPinia())
app.mount('#app')

// app.config.productionTip = false
//设置axios请求url基础部分
// axios.defaults.baseUrl="http://localhost:8082"
//挂载到原型，通过$符直接用
app.config.globalProperties.$axios=axios;
app.config.globalProperties.$setSessionStorage=setSessionStorage;
app.config.globalProperties.$getSessionStorage=getSessionStorage;
app.config.globalProperties.$removeSessionStorage=removeSessionStorage;
app.config.globalProperties.$getCurDate=getCurDate;

app.config.globalProperties.$setLocalStorage=setLocalStorage;
app.config.globalProperties.$getLocalStorage=getLocalStorage;
app.config.globalProperties.$removeLocalStorage=removeLocalStorage;
app.config.globalProperties.$querystring=querystring;


